package CoteServeur;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.util.Scanner;
import java.util.Vector;


public class Chat_ClientServeur implements Runnable {
	 
    private Socket socket = null;
    private BufferedReader in = null;
    private PrintWriter out = null;
    private String login = "zero";
    private Thread t3, t4;
    private ControleurServeur controleur;
     
    public Chat_ClientServeur(Socket s,String log, ControleurServeur cont){
        socket = s;
        login = log;
        controleur = cont;
    }
    public void run() {
         
        try {
        	
        in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
        out = new PrintWriter(socket.getOutputStream());
        
//        controleur.getVecOut().add(socket);
//        
//        
//        Thread t3 = new Thread(new Reception(in,login, controleur));
//        t3.start();
//        t3.join();
        
        //Scanner sc = new Scanner(System.in);
        
       // System.out.println("Votre message : ");
       // String message = sc.nextLine();
     /*   if(controleur.getMessage()!= null || controleur.getMessage() != ""){
        	
        String message = controleur.getMessage();
        Vector<Socket> vec = controleur.getVecOut();

        	System.out.println(vec);	
        for(int i = 0; i< vec.size();i++)
        {
        	out = new PrintWriter(vec.get(i).getOutputStream());
        	Thread t4 = new Thread(new Emission(out, message));
            t4.start();	    
            System.out.println("verification modification");
        }  
        }  */     
        } catch (IOException e) {
            System.err.println(login +"s'est déconnecté ");
        } 
            //catch (InterruptedException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
        
}
}